function reset(ran_seed) {
    var state;
    $.ajax({
        url: "/reset",
        data: String(ran_seed),
        type: "POST",
        async: false,
        success: function (result) {
            state = result;
            // console.log(state);
        }
    });
    return JSON.parse(state);

}

function step(action) {
    var state;
    $.ajax({
        url: "/step",
        data: JSON.stringify(action),
        type: "POST",
        async: false,
        success: function (result) {
            state = result;
            // console.log(state);
        }
    });
    return JSON.parse(state);

}

function topy(function_name,parameters) {
    var return_result;
    $.ajax({
        url: "/topy",
        data: JSON.stringify([function_name,parameters]),
        type: "POST",
        async: false,
        success: function (result) {
            return_result = result;
        }
    });
    return JSON.parse(return_result);

}




